﻿namespace ltModel.Model
{
    #region article_user.Model
    /// <summary>
    /// 实体类article_user(用户表)
    /// </summary>
    public class article_user
    {
        public article_user()
        { }
        #region Model
        private int _user_id;
        private string _username;
        private string _userpass;
        private string _is_man;
        private string _regdate;
        private string _lasttime;
        private int _fb_num;
        private int _sh_num;
        private string _regip;
        private string _truename;
        private string _sex;
        private string _oicq;
        private string _email;
        private string _homepage;
        private string _jm;
        private string _lmqx;
        private string _funcqx;
        private string _lock;
        private int _role_id;
        /// <summary>
        /// 用户ID
        /// </summary>
        public int user_id
        {
            set { _user_id = value; }
            get { return _user_id; }
        }
        /// <summary>
        /// 用户名
        /// </summary>
        public string username
        {
            set { _username = value; }
            get { return _username; }
        }
        /// <summary>
        /// 用户密码
        /// </summary>
        public string userpass
        {
            set { _userpass = value; }
            get { return _userpass; }
        }
        /// <summary>
        /// 等级
        /// </summary>
        public string is_man
        {
            set { _is_man = value; }
            get { return _is_man; }
        }
        /// <summary>
        /// 注册时间
        /// </summary>
        public string regdate
        {
            set { _regdate = value; }
            get { return _regdate; }
        }
        /// <summary>
        /// 最后登录时间
        /// </summary>
        public string lasttime
        {
            set { _lasttime = value; }
            get { return _lasttime; }
        }
        /// <summary>
        /// 发布数量
        /// </summary>
        public int fb_num
        {
            set { _fb_num = value; }
            get { return _fb_num; }
        }
        /// <summary>
        /// 审核数量
        /// </summary>
        public int sh_num
        {
            set { _sh_num = value; }
            get { return _sh_num; }
        }
        /// <summary>
        /// 注册IP
        /// </summary>
        public string regip
        {
            set { _regip = value; }
            get { return _regip; }
        }
        /// <summary>
        /// 真实姓名
        /// </summary>
        public string truename
        {
            set { _truename = value; }
            get { return _truename; }
        }
        /// <summary>
        /// 性别
        /// </summary>
        public string sex
        {
            set { _sex = value; }
            get { return _sex; }
        }
        /// <summary>
        /// IQ
        /// </summary>
        public string oicq
        {
            set { _oicq = value; }
            get { return _oicq; }
        }
        /// <summary>
        /// 电子邮箱
        /// </summary>
        public string email
        {
            set { _email = value; }
            get { return _email; }
        }
        /// <summary>
        /// 主页
        /// </summary>
        public string homepage
        {
            set { _homepage = value; }
            get { return _homepage; }
        }
        /// <summary>
        /// 
        /// </summary>
        public string jm
        {
            set { _jm = value; }
            get { return _jm; }
        }
        /// <summary>
        /// 栏目权限
        /// </summary>
        public string lmqx
        {
            set { _lmqx = value; }
            get { return _lmqx; }
        }
        /// <summary>
        /// 发布权限
        /// </summary>
        public string funcqx
        {
            set { _funcqx = value; }
            get { return _funcqx; }
        }
        /// <summary>
        /// 是否锁定
        /// </summary>
        public string Lock
        {
            set { _lock = value; }
            get { return _lock; }
        }
        /// <summary>
        /// 
        /// </summary>
        public int role_id
        {
            set { _role_id = value; }
            get { return _role_id; }
        }
        #endregion Model

        private bool? isManager;
        /// <summary>
        /// 是否为管理员
        /// </summary>
        public bool IsManager
        {
            get
            {
                if (isManager == null)
                {
                    if (string.IsNullOrEmpty(_is_man))
                        isManager = false;
                    int m;
                    if (int.TryParse(_is_man, out m))
                    {
                        isManager = m == 0;
                    }
                    else
                        isManager = false;
                }
                return isManager.Value;
            }
        }
    }
    #endregion
}

